<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!doctype html>
<html>
<head>
<base href="<%=basePath%>">
<meta charset="utf-8" http-equiv="content-type" content="text/html">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>我的消息</title>

<link href="css/jquery.mobile-1.4.5.min.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.11.3.min.js" type="text/javascript"></script>

<link rel="stylesheet" type="text/css" href="css/mynews.css" />
<link rel="stylesheet" type="text/css" href="css/footer.css">
<link rel="stylesheet" type="text/css" href="css/style.css" />

<script>
$(document).bind('mobileinit',function(){
 $.mobile.changePage.defaults.changeHash = false;
 $.mobile.hashListeningEnabled = false;
 $.mobile.pushStateEnabled = false;
});
</script>
<script src="js/jquery.mobile-1.4.5.min.js" type="text/javascript"></script>
</head>
<body>
<div data-role="page">
	<div data-role="content" id="content">
				
	</div>

	 <jsp:include page="../footer.jsp" flush="true" />
</div>
</body>
<script type="text/javascript">
setBase();
function setBase(){
	getMsgList();
}

//获取消息列表
function getMsgList(){
	$.post("api/myself/getMessageList.do",function(data){
		if(data["STATUS"]=="OK"){
			var content =  $("#content");
			var resultListJson = eval("("+data["RESULTLIST"]+")");
			var html= '';
			$.each(resultListJson,function(keyDaily,valueDaily){
				html += '<div class="mynew">';
				html += '<a href="'+valueDaily.URL+'">';
				html += '<img class="o-u-face" src="'+valueDaily.USERIMG+'" />';
				html += '<div class="o-u-detail">';
				html += '<p class="o-u-name">'+valueDaily.USERNICKNAME+'</p>';
				html += '<span class="read">已读</span>';
				html += '<p>'+valueDaily.MSG+' <span>| '+valueDaily.TIME+'</span></p>';
				html += '</div>';
				html += '<img class="goods-pic" src="'+valueDaily.THINGIMG+'" />	';
				html += '</a>';
				html += '</div>';
			});
			$("#content").html(html);
		}
	},'json')
}
</script>
</html>